﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace WebServiceXiu
{
    /// <summary>
    /// Service1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class KaoHeAPI : System.Web.Services.WebService
    {
        LightXiuCore.MySqlDatabase dataAccess = new LightXiuCore.MySqlDatabase("server=182.18.22.150;user id=zjwdb_165769; password=zjwdb_165769; database=zjwdb_165769; pooling=false;Charset=utf8");

       
        [WebMethod]
        public System.Data.DataTable GetDataBySql(string sql,string tableName)
        {
            var dt = new System.Data.DataTable(tableName); ;
           return dataAccess.Fill(sql, dt);
        }

   

        [WebMethod]
        public int UpdateData(System.Data.DataTable data,string querySql,string delSql)
        {
            if (!string.IsNullOrEmpty(delSql))
            {
                dataAccess.ExecuteNonQuery(delSql);
            }
            return dataAccess.Update(querySql, data);
           
        }
    }
}